package link.anyauto.dtbinding.list;

import android.content.Context;
import android.widget.Toast;

import link.anyauto.dtbinding.R;
import link.anyauto.dtbinding.base.App;

/**
 * Created by LYQ on 2016/7/26.
 */
public class ListHandlers {

    public void add() {
        vm.items.add(0, App.getStr(R.string.item_value_n, vm.items.size() + 1));
    }

    public void remove() {
        if(vm.items.size() > 0) {
            vm.items.remove(0);
        }
    }

    public void itemClick(int position) {
        Toast.makeText(ctx, App.getStr(R.string.toast_selection, vm.items.size() - position), Toast.LENGTH_SHORT).show();
    }

    ListVM vm;
    Context ctx;
}
